package com.book.service.impl;

import com.book.dao.CategoryDao;
import com.book.pojo.Category;
import com.book.service.CategoryService;
import com.book.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService {
    @Autowired
    private CategoryDao categoryDao;
    @Autowired
    private RedisUtil redisUtil;

    @Override
    public List<Category> getCategoryList(Integer parentId) {
        return categoryDao.getList(parentId);
    }

    @Override
    public Category getCategoryById(Integer classId) {
        return categoryDao.selectByPrimaryKey(classId);
    }

    @Override
    public Category getParentCategoryList(Integer cataId) {
        return categoryDao.getParentCategoryList(cataId);
    }
}
